package com.zdkj.subway.rca.util;

import com.zdkj.admin.api.vo.UserVO;
import com.zdkj.common.security.service.PigxUser;
import com.zdkj.common.security.util.SecurityUtils;
import com.zdkj.subway.rca.dto.in.UserDto;
/**
 * 用户信息工具类
 * @author Magic
 *
 */
public class UserUtil {
	/**
	 * 构造UserDto函数
	 * @return
	 */
    public static UserDto userDto(){
        UserDto user = new UserDto();
        user.setId(1);
        user.setUserName("admin");
        user.setNikeName("管理员");
        user.setUserCode("001");
        user.setDeptId(1);
        return user;
    }
    /**
	 * 构造UserDto函数
	 * @return
	 */
    public static UserDto pigxUser() {
        PigxUser pigxUser = SecurityUtils.getUser();
        UserDto user = new UserDto();
        user.setId(pigxUser.getId());
        user.setUserName(pigxUser.getUsername());
        user.setNikeName(pigxUser.getNikeName());
        user.setUserCode(pigxUser.getUserCode());
        user.setDeptId(pigxUser.getDeptId());
        return user;
    }
}
